package com.xsyi.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xsyi.model.User;
import com.xsyi.service.UserService;
import com.xsyi.service.impl.UserServiceImpl;


@Controller
public class UserAction {

	private static final Logger log=Logger.getLogger(UserAction.class);
	@Autowired
	private UserService userService;
	
	@RequestMapping("/showUser")
	public String showUser(HttpServletRequest request,HttpServletResponse response){
		String id=request.getParameter("id");
		log.info("===id="+id);
		User user=userService.getUserById(id);
		request.setAttribute("user", user);
		return "showUser";
	}
}
